//
//  HYTouchTableView.m
//  Booking
//
//  Created by Maybe_文仔 on 2018/9/27.
//  Copyright © 2018年 Duntech. All rights reserved.
//

#import "HYTouchTableView.h"
#import "HYReservedDetailView.h"

@implementation HYTouchTableView

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    if ([self.touchDelegate respondsToSelector:@selector(tableView:touchesBegan:withEvent:)]) {
        [self.touchDelegate tableView:self touchesBegan:touches withEvent:event];
    }
}

-(void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    if ([self.touchDelegate respondsToSelector:@selector(tableView:touchesMoved:withEvent:)]) {
        [self.touchDelegate tableView:self touchesMoved:touches withEvent:event];
    }
}

-(void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    if ([self.touchDelegate respondsToSelector:@selector(tableView:touchesEnded:withEvent:)]) {
        [self.touchDelegate tableView:self touchesEnded:touches withEvent:event];
    }
}

-(BOOL)touchesShouldBegin:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event inContentView:(UIView *)view{
    NSLog(@"touchesShouldBegin");
    if ([view isMemberOfClass:[HYReservedDetailView class]]) {
        return NO;
    }
    return YES;
}

-(BOOL)touchesShouldCancelInContentView:(UIView *)view{
    NSLog(@"touchesShouldCancelInContentView");
    if ([view isKindOfClass:[HYTouchTableView class]]) {
        return YES;
    }
    return NO;
}

@end
